home *** CD-ROM | disk | FTP | other *** search
/ Ahoy 1986 February / Ahoy_Magazine_86-02_1986_Double_L.d64 / head to head (.txt) < prev    next >
Commodore BASIC  |  2022-10-26  |  5KB  |  195 lines

  1. 1 rem *********************************
  2. 2 rem *                               *
  3. 3 rem *   'head to head' (c) 1985     *
  4. 4 rem *       by   doug smoak         *
  5. 5 rem *            303 heyward st.    *
  6. 6 rem *            columbia, s.c.     *
  7. 7 rem *            29201              *
  8. 8 rem *                               *
  9. 9 rem *********************************
  10. 10 dima(3),x(4),c(4)
  11. 20 a(0)=2:a(2)=-80:a(1)=-2:a(3)=80
  12. 30 x(0)=0:x(1)=-40:x(2)=40:x(3)=-1:x(4)=1
  13. 40 c(0)=0:c(1)=30:c(2)=22:c(3)=60:c(4)=62
  14. 50 bo=53280:bg=bo+1:sc=1024:wl=160:hl=46
  15. 60 sid=54272:cd=sid
  16. 70 dn$=""
  17. 80 ds$=dn$+""
  18. 90 gosub880:pokebo,0:pokebg,0:poke646,14
  19. 100 gosub1600
  20. 110 fori=49152to49152+213
  21. 120 reada:pokei,a:next
  22. 130 gosub1130
  23. 140 print"[147][155]"dn$"bonus feature y/n[146]";
  24. 150 inputbs$
  25. 160 print"[147]"dn$"how many rounds";
  26. 170 inputrd$:rd=val(rd$)
  27. 180 ifrd=0thenrd=1
  28. 190 :
  29. 200 rem ** main loop **
  30. 210 :
  31. 220 forii=1tord
  32. 230 pokebo,0:pokebg,0
  33. 240 m1=1905:m2=1925:c1=30:c2=c1:tp=0
  34. 250 poke198,0
  35. 260 print"[147]"dn$"what number maze";
  36. 270 inputmz$:mz=val(mz$):mz$=""
  37. 280 print"[147]":ifmz=0thenmz=rnd(1)
  38. 290 fori=0to22
  39. 300 print"                                      [146]";
  40. 310 next
  41. 320 a9=sc+81:gosub670:mz=0
  42. 330 ifbs$<>"y"then390
  43. 340 x=int(rnd(1)*5)+2
  44. 350 y=int(rnd(1)*8)+2
  45. 360 fori=sc+x*40+ytosc+x*40+19
  46. 370 ifpeek(i)=160thenpokei,86:pokei+20,86:pokei+cd,7:pokei+20+cd,7:goto390
  47. 380 next
  48. 390 ti$="000000"
  49. 400 pokem1,c1:pokem2,c2
  50. 410 o1=m1:o2=m2
  51. 420 poke49301,255:sys49223
  52. 430 print"[158]round"iitab(20)"sec"10-val(right$(ti$,2))"[157] "
  53. 440 ifval(right$(ti$,2))<10then430
  54. 450 sys49152:j1=peek(253)
  55. 460 m1=o1+x(j1):w1=peek(m1)
  56. 470 ifw1=c1orw1=wlthen520
  57. 480 ifw1=hlthentp=tp+1:p1=p1+10:pokem1+20,32
  58. 490 ifw1=86thenp1=p1+500:pokem1+20,32
  59. 500 pokeo1,32:pokem1,c(j1)
  60. 510 o1=m1:c1=c(j1):goto530
  61. 520 m1=o1
  62. 530 sys49152:j2=peek(254)
  63. 540 m2=o2+x(j2):w2=peek(m2)
  64. 550 ifw2=c2orw2=wlthen600
  65. 560 ifw2=hlthentp=tp+1:p2=p2+10:pokem2-20,32
  66. 570 ifw2=86thenp2=p2+500:pokem2-20,32
  67. 580 pokeo2,32:pokem2,c(j2)
  68. 590 o2=m2:c2=c(j2):goto610
  69. 600 m2=o2
  70. 610 print"[158]score"p1tab(20)"score"p2
  71. 620 iftp>=196thensys49287:gosub880:gosub1090:nextii:goto920
  72. 630 goto450
  73. 640 :
  74. 650 rem *** create playfield ***
  75. 660 :
  76. 670 zm=rnd(-mz)
  77. 680 j=int(rnd(1)*4):x3=j
  78. 690 b=a9+a(j)
  79. 700 ifpeek(b)=wlthengosub800:goto680
  80. 710 j=(j+1)*-(j<3):ifj<>x3then690
  81. 720 j=peek(a9)
  82. 730 pokea9,hl:pokea9+cd,1
  83. 740 pokea9+20,hl:pokea9+cd+20,1
  84. 750 ifj<4thena9=a9-a(j):goto680
  85. 760 return
  86. 770 :
  87. 780 rem *** playfield sub ***
  88. 790 :
  89. 800 pokeb,j:pokea9+a(j)/2,hl
  90. 810 pokea9+cd+a(j)/2,1
  91. 820 pokeb+20,j:poke(a9+a(j)/2)+20,hl
  92. 830 poke20+a9+cd+a(j)/2,1:a9=b
  93. 840 return
  94. 850 :
  95. 860 rem ** setup sound chip **
  96. 870 :
  97. 880 fori=0to24:pokesi+i,0:next:pokesi+24,15:pokesi+6,240:return
  98. 890 :
  99. 900 rem *** game over ***
  100. 910 :
  101. 920 ifp1>p2thenpl$="player one, that's you on the left!":goto950
  102. 930 ifp2>p1thenpl$="player two, that's you on the right!":goto950
  103. 940 ifp2=p1thenpl$="       nobody, it's a tie!!!??"
  104. 950 print"[147][158]the final scores are:"
  105. 960 print"player one:"p1
  106. 970 print"[158]player two:"p2
  107. 980 print"[158]the winner is:"
  108. 990 print""pl$
  109. 1000 print"[158]            play again  y/n[146] ?";
  110. 1010 fori=1to1000:next:poke198,0
  111. 1020 geta$
  112. 1030 ifa$="n"thenprint"[147]";:end
  113. 1040 ifa$<>"y"then1020
  114. 1050 p1=0:p2=0:rd=0:ii=0:goto140
  115. 1060 :
  116. 1070 rem  *** check for end ***
  117. 1080 :
  118. 1090 ifrd>0andii=rdthenreturn
  119. 1100 :
  120. 1110 rem  *** wait for input ***
  121. 1120 :
  122. 1130 print"[129]press return to continue";
  123. 1140 cl=rnd(0)*15+1
  124. 1150 ifrd=0thenpoke646,cl:gosub1600:printds$"by doug smoak "
  125. 1160 if(peek(197)<>1)then1140
  126. 1170 poke198,0:return
  127. 1180 :
  128. 1190 rem ** m.l. j-stick data **
  129. 1200 :
  130. 1210 data169,0,133,254,173,0,220
  131. 1220 data74,176,4,160,1,132,254,74
  132. 1230 data176,4,160,2,132,254,74,176
  133. 1240 data4,160,3,132,254,74,176
  134. 1250 data4,160,4,132,254,169,0,133
  135. 1260 data253,173,1,220,74,176,4
  136. 1270 data160,1,132,253,74,176,4
  137. 1280 data160,2,132,253,74,176,4,160
  138. 1290 data3,132,253,74,176,4,160
  139. 1300 data4,132,253,96
  140. 1310 :
  141. 1320 rem ** interrupt music data **
  142. 1330 :
  143. 1340 data120,169,84,141,20,3,169
  144. 1350 data192,141,21,3,88,96,173,148
  145. 1360 data192,208,40,174,149,192
  146. 1370 data232,224,64,208,2,162,0,189
  147. 1380 data150,192,141,0,212,232,189
  148. 1390 data150,192,141,1,212,232,189
  149. 1400 data150,192,141,4,212,232,189
  150. 1410 data150,192,141,148,192,142,149
  151. 1420 data192,206,148,192,76,49,234
  152. 1430 data120,169,49,141,20,3,169
  153. 1440 data234,141,21,3,88,96
  154. 1450 data 0,255
  155. 1460 :
  156. 1470 rem ** music notes data **
  157. 1480 :
  158. 1490 data 96,22,17,15,195,16,17,15
  159. 1500 data 24,14,17,15,195,16,17,15
  160. 1510 data 96,22,17,15,195,16,17,15
  161. 1520 data 24,14,17,15,195,16,17,15
  162. 1530 data 239,14,17,15,195,16,17,15
  163. 1540 data 239,14,17,15,195,16,17,15
  164. 1550 data 239,14,17,15,195,16,17,15
  165. 1560 data 209,18,17,15,31,21,17,15
  166. 1570 :
  167. 1580 rem *** title page ***
  168. 1590 :
  169. 1600 print"                                       ";
  170. 1610 print"       [176][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][174][146]     ";
  171. 1620 print"       [221][146]                          [221][146]     ";
  172. 1630 print"       [221][146]      [146]  [146]    [146] [169] [223][146]   [223][146]      [221][146]     ";
  173. 1640 print"       [221][146]      [146]  [146]  [146]    [146]  [146]  [146]  [146]      [221][146]     ";
  174. 1650 print"       [221][146]      [162] [146]  [162][146]   [162] [146]  [146]  [146]      [221][146]     ";
  175. 1660 print"       [221][146]      [146]  [146]  [146][162][162]  [146]  [146]  [146][162] [146]      [221][146]     ";
  176. 1670 print"       [221][146]                          [221][146]     ";
  177. 1680 print"       [221][146]            [146]    [146]          [221][146]     ";
  178. 1690 print"       [221][146]           [146]   [146]  [146]          [221][146]     ";
  179. 1700 print"       [221][146]           [146]   [146]  [146]          [221][146]     ";
  180. 1710 print"       [221][146]           [146]   [146][162] [146]          [221][146]     ";
  181. 1720 print"       [221][146]                          [221][146]     ";
  182. 1730 print"       [221][146]      [146]  [146]    [146] [169] [223][146]   [223][146]      [221][146]     ";
  183. 1740 print"       [221][146]      [146]  [146]  [146]    [146]  [146]  [146]  [146]      [221][146]     ";
  184. 1750 print"       [221][146]      [162] [146]  [162][146]   [162] [146]  [146]  [146]      [221][146]     ";
  185. 1760 print"       [221][146]      [146]  [146]  [146][162][162]  [146]  [146]  [146][162] [146]      [221][146]     ";
  186. 1770 print"       [221][146]                          [221][146]     ";
  187. 1780 print"       [221][146]      by doug smoak       [221][146]     ";
  188. 1790 print"       [221][146]                          [221][146]     ";
  189. 1800 print"       [173][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][189][146]     ";
  190. 1810 print"                                        ";
  191. 1820 print"                                        ";
  192. 1830 print"                                        ";
  193. 1840 poke646,rnd(0)*15+1
  194. 1850 return
  195.